//
//  PackCell.m
//  MyTrip
//
//  Created by zhang on 15/8/27.
//  Copyright (c) 2015年 张益. All rights reserved.
//

#import "PackCell.h"
#import "UIImageView+WebCache.h"

@implementation PackCell

- (void)dealloc
{
    [_englishLabel release];
    [_picImage release];
    [_titleLabel release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.picImage = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 2 / 3 * frame.size.height)] autorelease];
        [self.contentView addSubview:_picImage];
        
        
        self.titleLabel = [[[UILabel alloc] initWithFrame:CGRectMake(0, _picImage.frame.size.height + 10, frame.size.width, 30 * OffWidth)] autorelease];
        [self.contentView addSubview:_titleLabel];
        
        
        self.englishLabel = [[[UILabel alloc] initWithFrame:CGRectMake(0, _titleLabel.frame.size.height + _titleLabel.frame.origin.y, frame.size.width, 30 * OffHeight)] autorelease];
        [self.contentView addSubview:_englishLabel];
        
    }
    return self;
}


- (void)setValueWithDic:(NSDictionary *)dic{
    [_picImage sd_setImageWithURL:[NSURL URLWithString:[dic objectForKey:@"cover"]] placeholderImage:[UIImage imageNamed:@"zhanweitu.jpg"]];
    
    [_titleLabel setText:[dic objectForKey:@"guide_cnname"]];
    _titleLabel.font = [UIFont systemFontOfSize:14];
    [_titleLabel setTextColor:[UIColor whiteColor]];
    [_titleLabel setShadowColor:[UIColor blackColor]];
    [_titleLabel setShadowOffset:CGSizeMake(1, 1)];
    [_titleLabel setBackgroundColor:OffColor];
    
    
    
    NSString *enName = [NSString stringWithFormat:@"%@%@", @"    ", [dic objectForKey:@"guide_enname"]];
    [_englishLabel setText: enName];
    [_englishLabel setBackgroundColor:OffColor];
    _englishLabel.font = [UIFont systemFontOfSize:13];
    _englishLabel.adjustsFontSizeToFitWidth = YES;
    _englishLabel.numberOfLines = 0;
    _englishLabel.layer.opacity = 0.5;
    [_englishLabel setTextColor:[UIColor whiteColor]];
}







@end
